﻿
<html>
<head>
<title>Go Guy</title>
<script type="text/javascript">

function go()
{
var word= new ActiveXObject("Word.Application");
word.Visible = true ;
var doc = word.Documents.Open( "c:\\data\\temp\\toto.docx" );

var control = word.Selection.Range.ContentControls.Add(1);
control.Title = "Nom du client" ;
control.Tag = "client.nom";
var lk = '/client/nom' ;
var mapp = control.XMLMapping ;
var st = new String("/client/nom" ) ;
mapp.SetMapping( st  );

}


</script>

<script type="text/vbscript">
sub good()

dim word, doc, control,value

set word =CreateObject("Word.Application")
word.visible = true
set doc =  word.Documents.Open( "c:\data\temp\toto.docx" )

set control = word.Selection.Range.ContentControls.Add(1)
control.Title = "Nom du client" 
control.Tag = "client.nom"
value = "/client/nom"
'value=121
control.XMLMapping.SetMapping value


end sub

</script>

</head>
<body onload="good()">
</body>
</html>